function validate (rulename, data) {
  const rule = require('@/validate/' + rulename).default
  for (const k in data) {
    if (Reflect.has(rule, k)) {
      const v = rule[k](data[k], data)
      if (v !== true) {
        return v
      }
    }
  }
  return true
}

export {
  validate
}
